﻿''' <summary>
''' This class defines a system metric that needs to be collected from the
''' system. System metrics are collected using WMI queries.
''' </summary>
''' <remarks></remarks>
Public Class WMIEntry

    ''' <summary>
    ''' System metric friendly name.
    ''' </summary>
    ''' <remarks></remarks>
    Protected m_name As String

    ''' <summary>
    ''' WMI query to retrieve information for this metric.
    ''' </summary>
    ''' <remarks></remarks>
    Protected m_WMIQuery As String

    ''' <summary>
    ''' List with specific data we need to collect.
    ''' </summary>
    ''' <remarks></remarks>
    Protected m_metrics As List(Of WMIMetric)

    ''' <summary>
    ''' Get/set the system metric friendly name.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Name() As String
        Get
            Return m_name
        End Get
        Set(ByVal value As String)
            m_name = value
        End Set
    End Property

    ''' <summary>
    ''' Get/set the WMI query.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property WMIQuery() As String
        Get
            Return m_WMIQuery
        End Get
        Set(ByVal value As String)
            m_WMIQuery = value
        End Set
    End Property

    ''' <summary>
    ''' Get/set the specific data list to be collected.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Metrics() As List(Of WMIMetric)
        Get
            Return m_metrics
        End Get
        Set(ByVal value As List(Of WMIMetric))
            m_metrics = value
        End Set
    End Property

    ''' <summary>
    ''' Default class constructor.
    ''' </summary>
    ''' <param name="Name">Friendly metric name.</param>
    ''' <param name="WMIQuery">WMI query.</param>
    ''' <remarks></remarks>
    Public Sub New(ByVal Name As String, ByVal WMIQuery As String)

        Me.Name = Name
        Me.WMIQuery = WMIQuery
        Metrics = New List(Of WMIMetric)

    End Sub

    ''' <summary>
    ''' Add a metric.
    ''' </summary>
    ''' <param name="o"></param>
    ''' <remarks></remarks>
    Public Sub AddMetric(ByVal o As WMIMetric)

        Metrics.Add(o)

    End Sub

End Class